import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 设置浏览器驱动
driver=webdriver.Edge()
# 启动浏览器网址
driver.get('http://10.59.9.12:7001/')
driver.maximize_window()
time.sleep(2)
# 点击登录
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
time.sleep(2)
# 断言登录页面
dy1 = driver.find_element(By.CLASS_NAME,'reg-new').text
assert '会员登录' == dy1
print(dy1)
# 输入用户名
driver.find_element(By.XPATH,'//input[@type="text" and @name="username"]').send_keys('123455556666')
time.sleep(2)
# 输入密码
driver.find_element(By.XPATH,'//input[@type="password" or @name="password"]').send_keys('123456')
time.sleep(10)
# 点击登录
driver.find_element(By.XPATH,'//a[@class="finish-btn"]').click()
time.sleep(5)
# 登录成功断言积分
dy2 = driver.find_element(By.XPATH,'/html/body/div[5]/div[2]/div[1]/div[2]/div[2]/ul/li[2]/span[1]').text
dy21 = dy2.replace(' 积分','')
print(dy21)
time.sleep(10)
driver.quit()




























